/*
 * Project: BoboDesignPattern
 * 
 * File Created at 2019年2月2日
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package chainOfResp;

/**
 * @Type DO
 * @Desc
 * @author 52489
 * @date 2019年2月2日
 * @Version V1.0
 */
public class DO {
    public static void main(String[] args) {
        Leader a = new Director("张主任");
        Leader b = new Manager("王经理");
        Leader c = new GeneralManager("戚总");

        // 动态增加
        a.setNextLeader(b);
        b.setNextLeader(c);

        LeaveRequest request = new LeaveRequest("小王", 2, "生病");
        LeaveRequest request1 = new LeaveRequest("小张", 10, "相亲");
        LeaveRequest request2 = new LeaveRequest("小东", 15, "回老家结婚");

        a.handleRequest(request);
        a.handleRequest(request1);
        a.handleRequest(request2);
    }
}
